home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 2004 #9
/
Amiga Plus CD - 2004 - No. 09.iso
/
amigaplus
/
tools
/
dev_libs
/
feelin040718
/
demos
/
fonts.c
< prev
next >
Wrap
C/C++ Source or Header
|
2004-08-03
|
4KB
|
119 lines
/*
This example shows how fonts are dynamic font handled
*/
#include <libraries/feelin.h>
#include <proto/exec.h>
#include <proto/dos.h>
#include <proto/feelin.h>
struct FeelinBase *FeelinBase;
///new_title
FObject new_title(STRPTR Title)
{
return TextObject,
FA_Frame, "0:03.06020602",
FA_Back, FI_HalfShadow,
FA_ChainToCycle, FALSE,
FA_Text, Title,
FA_Text_PreParse, "<align=center><pens style=emboss>",
FA_Text_VCenter, TRUE,
FA_Weight, 5,
End;
}
//+
///new_string
FObject new_string(void)
{
return StringObject,
FA_SetMax, FALSE,
"FA_String_AdvanceOnCR", FALSE,
"FA_String_MaxLen", 32,
End;
}
//+
///new_image
FObject new_image(void)
{
return ImageObject,
FA_ChainToCycle, FALSE,
FA_SetMax, TRUE,
"FA_Image_Spec", "B:Loupe",
End;
}
//+
void main(void)
{
FObject app,win,str_1,str_2,str_3;
if (FeelinBase = (struct FeelinBase *) OpenLibrary("feelin.library",FV_VERSION))
{
app = AppObject,
FA_ColorScheme, "c:64DC82,c:55AF64,c:0A460A,c:FF0000,c:FFFFFF",
Child, win = WindowObject,
FA_Back, "P:Feelin:Images/StripGreen.png",
FA_Window_Title, "Feelin : Fonts",
FA_Window_Open, TRUE,
Child, VGroup,
Child, TextObject,
FA_ChainToCycle, FALSE,
FA_Text, "<align=center><pens text=halfdark shadow=halfshadow>Changing fonts will<br>dynamically update layout.<br>Try <b><font face=topaz size=8>topaz/8</font></b> to see...",
FA_SetMax, FV_SetMaxH,
End,
Child, VGroup, FA_Group_Rows, 3,
Child, new_title("Icons"),
Child, str_1 = new_string(),
Child, new_image(),
Child, new_title("Default"),
Child, str_2 = new_string(),
Child, new_image(),
Child, new_title("Screen"),
Child, str_3 = new_string(),
Child, new_image(),
End,
Child, Bar,
Child, HGroup, FA_Group_SameSize,TRUE,
Child, SimpleButton("<b>Save</b>"),
Child, SimpleButton("<pens text=halfdark>Use</pens>"),
Child, SimpleButton("<pens text=highligth>Cancel</pens>"),
End,
End,
End,
End;
if (app)
{
F_Do(str_1,FM_Notify,"FA_String_Changed",FV_Notify_Always,FV_Notify_Self,FM_Set,2,FA_Font,FV_Notify_Value);
F_Do(str_2,FM_Notify,"FA_String_Changed",FV_Notify_Always,FV_Notify_Self,FM_Set,2,FA_Font,FV_Notify_Value);
F_Do(str_3,FM_Notify,"FA_String_Changed",FV_Notify_Always,FV_Notify_Self,FM_Set,2,FA_Font,FV_Notify_Value);
F_Set(str_1,(ULONG) "FA_String_Contents",(ULONG) "Helvetica/9");
F_Set(str_2,(ULONG) "FA_String_Contents",(ULONG) "Helvetica/11");
F_Set(str_3,(ULONG) "FA_String_Contents",(ULONG) "Helvetica/13");
F_Do(win,FM_Notify,FA_Window_CloseRequest,TRUE,app,FM_Application_Shutdown,0);
F_Do(app,FM_Application_Run);
F_DisposeObj(app);
}
CloseLibrary(FeelinBase);
}
else
{
Printf("Unable to open feelin.library v%ld\n",FV_VERSION);
}
}